<template>
	<view class="bg min100 white">
		<u-tabs :list="tabs"  active-color="#e66633" inactive-color="#3c3c3c" bg-color="transparent"  :is-scroll="false" :current="current" @change="change"></u-tabs>
		<empty v-if="list.length==0"></empty>
		<view class="mlr-30 mt-20" v-else>
			<view class="size-26 gray-3 mb-20 radius-20 ptb-20 plr-30 bg-1" v-for="(item,index) in list"
				:key="index">
				<view class=" flex flex-between  mb-10">
					<view class="bold size-30">
						<view v-if="item.status==0" style="color:#EFAA1C">待审核</view>
						<view v-if="item.status==1" style="color:green">已通过</view>
						<view v-if="item.status==2" style="color:red">已拒绝</view>
					</view>
					<view class="size-26">
						提现方式：
					    <text v-if="item.type == 1">微信</text>
						<text v-if="item.type == 2">支付宝</text>
						<text v-if="item.type == 3">银行卡</text>
					</view>
				</view>
				<view class="flex flex-between mb-20">
					<view class="">
						账号：{{item.name}}
					</view>
					<view class="">
						提现金额：{{item.account}}
					</view>
				</view>
				<view class="flex flex-between mb-20">
					<view class="">
						{{item.create_time}}
					</view>
					<view class="">
						实际到账金额：{{item.reality_account}}
					</view>
				</view>
				<view class="flex flex-between" v-if="item.status==2">
					<view class="">

					</view>
					<view class="">
						拒绝原因：{{item.refuse}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import empty from "../../components/empty.vue"
	export default {
		components: {
			empty
		},
		data() {
			return {
				tabs: [{
					name: '全部'
				}, {
					name: '待审核'
				}, {
					name: '已通过'
				}, {
					name: '已拒绝'
				}],
				current: 0,
				status: '',
				list: []
			}
		},
		onShow() {
			this.init();
		},
		methods: {
			init() {
				this.$http('api/draw/drawRecordList', {
					status: this.status
				}).then(res => {
					this.list = res;
				})
			},
			change(index) {
				this.current = index;
				if(index==0){
					this.status ='';
				}else{
					this.status = Number(index - 1);
				}
				this.list = [];
				this.init();
			}
		}
	}
</script>

<style lang="less" scoped>
	.bg-1 {
		background-color: #fff;
		color: #3c3c3c;
	}
	/deep/ .u-tab-bar {
		
		background: linear-gradient(90deg, #EEA634, #DE2D32);
	}
</style>
